import java.util.*;
public class demo05 {
    //时间显示
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long sum=sc.nextLong();
        sum/=1000;
        sum%=60*60*24;
        long hour=sum/(60*60);
        String hour1=""+hour;
        if(hour<10){
            hour1="0"+hour;
        }
        sum%=60*60;
        long min=sum/60;
        String min1=""+min;
        if(min<10){
            min1="0"+min;
        }
        long ss=sum%60;
        String ss1=""+ss;
        if(ss<10){
            ss1="0"+ss;
        }
        System.out.println(hour1+":"+min1+":"+ss1);
    }
}
